﻿using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc.Razor;
using Microsoft.Extensions.Caching.Memory;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace WebApplication4
{
    public static class RazorPageExtension
    {
        public static string AddAppendVersion(this IRazorPage page, string path)
        {
            //获取视图上下文
            var context = page.ViewContext.HttpContext;
            //容器中获取内置缓存
            IMemoryCache memoryCache = context.RequestServices.GetService(typeof(IMemoryCache)) as IMemoryCache;
            //容器中获取IWebHostEnvironment
            IWebHostEnvironment env = context.RequestServices.GetService(typeof(IWebHostEnvironment)) as IWebHostEnvironment;

            //var fileversionProvider=new FileVersionProvider(env.WebRootFileProvider);

            return "";
        }
    }
}
